package com.abc.controller;

import com.abc.entity.User;
import com.abc.service.IUserService;
import com.abc.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users")
public class UserController extends BaseController {
    @Autowired
    private IUserService userService;
    @RequestMapping("/reg")
    public JsonResult<Void> reg(User user) {
        // 执行注册
        userService.reg(user);
        // 返回成功
        JsonResult<Void> jr = new JsonResult<Void>();
        jr.setState(1);
        return jr;
    }
}
